#pragma once

#include "../umlmodel_global.h"

#include "Feature.h"
#include "MultiplicityElement.h"
#include "TypedElement.h"

namespace uml {

/// <summary>
/// StructuralFeature
/// A StructuralFeature is a typed feature of a Classifier that specifies the
/// structure of instances of the Classifier.
/// </summary>
class UMLMODEL_EXPORT StructuralFeature : public MultiplicityElement, public TypedElement, public Feature {

public: // Constructors and destructors
    explicit StructuralFeature(const QString& umlType="uml::StructuralFeature");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// isReadOnly getter
    /// If isReadOnly is true, the StructuralFeature may not be written to after
    /// initialization.
    /// </summary>
    bool isReadOnly() const;

    /// <summary>
    /// isReadOnly setter
    /// If isReadOnly is true, the StructuralFeature may not be written to after
    /// initialization.
    /// </summary>
    void setIsReadOnly(bool value);

private: // Fields
    /// <summary>
    /// isReadOnly
    /// If isReadOnly is true, the StructuralFeature may not be written to after
    /// initialization.
    /// </summary>
    const static bool isReadOnly_default_;
    bool isReadOnly_= isReadOnly_default_;

};

} // namespace uml
